package com.kingsoft.dc.khaos.scheduler

import com.kingsoft.dc.khaos.metadata.{ModuleCommon, TaskInfo}

/**
  * Created by chengguangqing on 2019/5/28.
  */
trait TaskScheduler  {

  private val appId = "khaos-application-" + System.currentTimeMillis()

  def setKhaosScheduler(dittoScheduler: KhaosScheduler): Unit

  def submitTasks(jobId: Int,
                  modules: List[ModuleCommon],
                  listener: ApplicationListener): Unit

  def runTask(taskId: Int,
              moduleCommon: ModuleCommon,
              taskOpInfo: TaskInfo,
              listener: ApplicationListener
             ): Unit

  def applicationId(): String = appId

  //def stop(): Unit
}
